<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script>
    // 使用fetch发送一个网络请求库 发送一个post请求
    fetch('http://127.0.0.1:3100/api/users/login', {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json',
            // 'source-client': 'miniapp'
        },
        body: JSON.stringify({
            userName: 'admin',
            userPwd: 'password',

        })
    })
        .then(res => res.json())
        .then(data => console.log(data))
        .catch(err => console.log(err))
    // fetch('https://api.github.com/users/github')
    //     .then(res => res.json())
    //     .then(data => console.log(data))
    //     .catch(err => console.log(err))
</script>

</html>